import java.text.DateFormatSymbols;

public class EventDate{
	public String year;
	public String month;
	public String day;
	public String hour;
	public String minute;

	public EventDate(){
		year = null;
		month = null;
		day = null;
		hour = null;
		minute = null;
	}

	public EventDate( String year, String month, String day, String hour, String minute ){
		setYear( year );
		setMonth( month );
		setDay( day );
		setHour( hour );
		setMinute( minute );
	}

	public void setYear( String year ){
		this.year = (year.length() == 2 ? "20" : "" ) + year;
	}

	public void setMonth( String month ){
		if( month.length() == 1 ){
			this.month = "0" + month;
		}else if( month.length() > 2 ){
			month = month.toLowerCase();
			String months[] = new DateFormatSymbols().getMonths();
			for( int i = 0; i < months.length; i++ ){
				if( months[i].toLowerCase().startsWith( month) ){
					this.month = (++i < 10 ? "0" : "" ) + i;
					break;
				}
			}
		}else{
			this.month = month;
		}
	}

	public void setDay( String day ){
		this.day = (day.length() == 1 ? "0" : "" ) + day;
	}

	public void setHour( String hour ){
		this.hour = (hour.length() == 1 ? "0" : "" ) + hour;
	}

	public void setMinute( String minute ){
		this.minute = (minute.length() == 1 ? "0" : "" ) + minute;
	}
}
